package Utils;

public class WEBRootUrl {
    private static String rootUrl="";
    WEBRootUrl() {
    }

    public static void setRootUrl() {
        try {
            rootUrl = WEBRootUrl.class.getResource("/").toURI().toString();
            rootUrl = rootUrl.replace("classes/", "");
            rootUrl = rootUrl.replace("file:/", "");
        }catch (Exception e){
            e.printStackTrace();
        }
    }

    public static String getRootUrl(){
        if(rootUrl.length() == 0)
            setRootUrl();
        return rootUrl;
    }
}
